import request from "@/request/";

// 获取列表
export const getList = (data) => {
  return request({
    url: "/api/mes-production-service/line/page",
    method: "POST",
    data,
  });
};

// 获取详情
export const getDetail = (id) => {
  return request({
    url: "/api/mes-production-service/line/detail",
    method: "POST",
    data: {
      id,
    },
  });
};

// 获取车间
export const getWorkShop = (factoryId) => {
  return request({
    url: "/api/trio-system/prod-org/find-all-workshop",
    method: "POST",
    data: { factoryId },
  });
};

// 新增
export const add = (data) => {
  return request({
    url: "/api/mes-production-service/line/save",
    method: "POST",
    data,
  });
};

// 更新
export const update = (data) => {
  return request({
    url: "/api/mes-production-service/line/update",
    method: "POST",
    data,
  });
};

// 更改状态
export const updateStatus = (data) => {
  return request({
    url: "/api/mes-production-service/line/state/update",
    method: "POST",
    data,
  });
};
